package com.hb.trade.server.center.au.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hb.core.pojo.center.au.dto.OrgCustomConfigDTO;
import com.hb.core.pojo.center.au.dto.OrgCustomConfigQueryDTO;
import com.hb.core.pojo.center.au.entity.OrgCustomConfig;
import com.hb.core.pojo.center.au.mapper.OrgCustomConfigMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hb.core.pojo.parent.PageResult;
import com.hb.trade.server.center.au.service.OrgCustomConfigService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 企业专属配置信息 服务实现类
 * </p>
 *
 * @author zhaojk
 * @since 2022-04-12
 */
@Service
public class OrgCustomConfigServiceImpl extends ServiceImpl<OrgCustomConfigMapper, OrgCustomConfig> implements OrgCustomConfigService {
    /**
     * 企业专属配置审核列表
     *
     * @param configDTO
     * @return
     */
    @Override
    public PageResult<OrgCustomConfigDTO> pageAudit(OrgCustomConfigQueryDTO configDTO) {
        Page<OrgCustomConfigDTO> pages = configDTO.pages();
        baseMapper.pageAudit(pages, configDTO);
        return PageResult.get(pages);
    }

    @Override
    public boolean domainExists(String domainName, Long orgId) {
        int count = baseMapper.domainExists(domainName, orgId);
        return count > 0;
    }
}
